<!Doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>大旺福--{$title}</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/assets/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/assets/layui/css/global.css" media="all">
    <link rel="stylesheet" href="/assets/layui/css/admin.css" media="all">
</head>
<body>
<div class="layui-layout layui-layout-admin">

    <!-- header start -->
    {include file="layout/header.html"}
    <!-- header end -->

    <!-- nav start-->
    {include file="layout/nav.html"}
    <!-- nav end-->

    <!-- main start -->
    <div class="layui-body site-demo">
        <div class="layui-main">
            <fieldset class="layui-elem-field layui-field-title">
                <legend>{$title}</legend>
            </fieldset>
            <div class="site-block">
                <div class="searchbar">
                    <form action="#" method="get" class="layui-form search-from">
                        <input type="hidden" name="search_list" value='{$search_array_str}'/>
                        <div class="layui-form-item">
                            <div class="layui-input-inline">
                                <select class="auto" name="search[shop_id]">
                                    <option value="">选择供应商</option>
                                    {foreach from=$shop item=one}
                                    <option value="{$one.id}" {if $search_array.shop_id eq $one.id}selected{/if}>{$one.shop_name}</option>
                                    {/foreach}
                                </select>
                            </div>
                            <div class="layui-input-inline">
                                <select class="auto" name="search[name]">
                                    <option value="name" {if $search_array.name eq 'name'} selected{/if}>商品名</option>
                                    <option value="goods_no" {if $search_array.name eq 'goods_no'} selected{/if}>商品货号</option>
                                </select>
                            </div>
                            <div class="layui-input-inline">
                                <input type="text" name="search[keywords]"  autocomplete="off" class="layui-input" value="{$search_array.keywords}">
                            </div>
                            <div class="layui-input-inline button-warp">
                                <input type="hidden" name="search[categroy_select_id]" value="">
                                <button type="button" class="layui-btn layui-btn-warm layui-btn-small category-select" style="margin-top:5px;"><i class="layui-icon">&#xe608;</i> <span>选择分类</span></button>
                            </div>
                            <div class="layui-input-inline button-warp">
                                <button type="button" class="layui-btn layui-btn-small search-button" style="margin-top:5px;"><i class="layui-icon">&#xe615;</i> <span>筛选</span></button>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="content">
                    <form action="#" method="get" class="layui-form no-margin">
                    <table class="layui-table" lay-even>
                        <colgroup>
                            <col width="50">
                            <col width="350">
                            <col width="200">
                            <col>
                        </colgroup>
                        <thead>
                            <tr>
                                <th>#</th>
                                <th>商品名称</th>
                                <th>分类</th>
                                <th>详情</th>
                            </tr>
                        </thead>
                        <tbody>
                        {foreach from=$products item=product}
                            <tr class="sel pro_{$product.id}">
                                <td>{$product.id}</td>
                                <td>{$product.product_name}</td>
                                <td>{foreach from=$product.category item=categoty}[{$categoty.category_name}]{/foreach}</td>
                                <td>
                                    <table class="layui-table" lay-skin="nob">
                                        <colgroup>
                                            <col width="50">
                                            <col width="50">
                                            <col width="50">
                                            <col width="50">
                                        </colgroup>
                                        <thead>
                                        <tr>
                                            <td>规格</td>
                                            <td>库存</td>
                                            <td>修改</td>
                                            <td>类型</td>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        {foreach from=$product.goodsList item=goods}
                                        <tr class="sku_{$product.id}">
                                            <td>
                                                {if $goods.spec_array|count eq 0}
                                                默认
                                                {else}
                                                {foreach from=$goods.spec_array item=sku}
                                                {$sku.value}
                                                {/foreach}
                                                {/if}
                                            </td>
                                            <td>{$goods.store_nums_real}</td>
                                            <td><input type="text" class="layui-input" value="0" onchange="setRealStoreNum('{$goods.id}','{$goods.sell_price}',this);"></td>
                                            <td>
                                                <select name="type">
                                                    <option value="0">入库</option>
                                                    <option value="1">修库</option>
                                                </select>
                                            </td>
                                        </tr>
                                        {/foreach}
                                        </tbody>
                                    </table>
                                </td>
                            </tr>
                        {/foreach}
                        </tbody>
                    </table>
                    </form>
                </div>
                <div class="layui-box layui-laypage layui-laypage-default">
                    {$pageStr}
                    <span>当前第{$currentPage}页/共{$totalPage}页</span>
                </div>
            </div>

        </div>
    </div>
    <!-- main end -->

</div>
<div id="category-content" style="display: none;">
    <input type="hidden" name="categroy_id" value="0">
    <button type="button" class="layui-btn layui-btn-warm layui-btn-small add-category layui-hide" style="margin-top:5px;"><i class="layui-icon">&#xe608;</i> <span>选择分类</span></button>
    <div class="category-list layui-clear site-block" style="padding:10px;">
        <ul id="category-tree" class="layui-box layui-tree" style="margin-bottom:10px;"></ul>
    </div>
</div>
{include file="layout/footerJs.html"}
<script src="/assets/layui/js/stock/stock_list.js"></script>
</body>
</html>